home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / sscanf.c < prev    next >
C/C++ Source or Header  |  1991-09-24  |  413b  |  28 lines

  1. #define __SRC__               /* fake prototypes */
  2. #include <stdio.h>
  3.  
  4. static int sgetc(s)
  5.     unsigned char **s;
  6.     {
  7.     register unsigned char c;
  8.  
  9.     c = *(*s)++;
  10.     return((c == '\0') ? EOF : c);
  11.     }
  12.  
  13. static int sungetc(c, s)
  14.     int c;
  15.     unsigned char **s;
  16.     {
  17.     if(c == EOF)
  18.         c = '\0';
  19.     return(*--(*s) = c);
  20.     }
  21.  
  22. sscanf(buf, fmt, arg)
  23.     const char *buf, *fmt;
  24.     int arg;
  25.     {
  26.     return(_scanf(&buf, sgetc, sungetc, fmt, &arg));
  27.     }
  28.